home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / comm / mebbs / lastu421.lha / logoff.rexx < prev    next >
OS/2 REXX Batch file  |  1994-08-11  |  2KB  |  64 lines

  1. /* Written by Mikael duck Johansson */
  2.  
  3. parse arg LineNumber
  4. signal on ERROR
  5.  
  6. DoorName = "LastUser"
  7.  
  8. if( ~show( 'l', "mebbsarexx.library" ) )then do
  9.    say "Opening mebbsarexx.library"
  10.  if( ~addlib( "mebbsarexx.library", 0, -30, 0 ) )then do
  11.       say "Could not open library"
  12.       exit 10
  13.    end
  14. end
  15.  
  16. call GetVar DoorName,LineNumber,1  ;  username=result
  17. call GetVar DoorName,LineNumber,11 ;  calls=result
  18. call GetVar DoorName,LineNumber,18 ;  total_calls=result
  19.  
  20. path="DOORS:"
  21. a=0
  22.  
  23. logoff=left(time(), 5, 3)
  24.  
  25. call open(file,path||'LastUser/LastUser.txt','R')
  26.      do until eof(file)
  27.     a=a+1
  28.     lin.a = readln(file)
  29.      end
  30. call close(file)
  31.  
  32. if LineNumber ~= "0" then do
  33. call open(file,path||'LastUser/LastUser.txt','W')
  34.      call writeln(file,lin.1''logoff' l')
  35.      call writeln(file,lin.2)
  36.      call writeln(file,lin.3)
  37.      call writeln(file,lin.4)
  38.      call writeln(file,lin.5)
  39.      call writeln(file,lin.6)
  40.      call writeln(file,lin.7)
  41.      call writeln(file,lin.8)
  42.      call writeln(file,lin.9)
  43.      call close(file)
  44. end
  45.  
  46. call Exit_Door DoorName,LineNumber
  47. exit 0
  48.  
  49. ERROR:
  50.     string=''                                                      
  51.     call output ; string='*BOOM*  Got an error.  PLEASE notify the sysop.'       
  52.     call output ; string='Line:' SIGL '   Severity:' RC                          
  53.     call output ; string=''                                                      
  54.     call output ; string='PLEASE write down the TYPE of ERROR and the LINE # and'
  55.     call output ; string='leave the SYSOP a message so he may get it corrected.' 
  56.     call output
  57.     call HotKey DoorName,LineNumber,"Press any key "
  58.     call Exit_Door DoorName,LineNumber
  59.     exit 10
  60.  
  61. output:
  62. call message DoorName,LineNumber,string,1
  63. return 
  64.